package com.liarjo.my_website_api.admin.controller.user;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.liarjo.my_website_api.admin.controller.user.page.AdminUserPageRequest;
import com.liarjo.my_website_api.admin.controller.user.page.AdminUserPageResult;


@Service
public class AdminUserService {
    @Autowired
    private AdminUserMapper userMapper;

    public IPage<AdminUserPageResult> page(AdminUserPageRequest userPageRequest) {
        IPage<AdminUserPageResult> page = new Page<>(userPageRequest.getCurrent(),userPageRequest.getSize());
        IPage<AdminUserPageResult> pageResult = userMapper.page(userPageRequest, page);
        return pageResult;
    }
}
